//
//  NewsCell.m
//  FoldTableViewCellDemo
//
//  Created by Anchoriter on 2018/1/31.
//  Copyright © 2018年 Anchoriter. All rights reserved.
//

#import "MeatShopRightSideCell.h"
#import "MeatShopRightModel.h"

@interface MeatShopRightSideCell()

@end

@implementation MeatShopRightSideCell


- (void)setupUI
{
    self.clipsToBounds = YES;
    
    self.meatShopUIComponent.view = self.contentView;
}

- (void)setupLayout{
    
    self.meatShopUIComponent.type = MeatFoldUILayoutType_HalfScreen;
}


#pragma mark - setter methods

- (void)setNewsModel:(MeatShopRightModel *)newsModel{
    
    _newsModel = newsModel;
    self.meatShopUIComponent.model = newsModel;
}


- (void)setModel:(PigTypeItem *)model
{
    _model = model;
    self.meatShopUIComponent.item = model;
}


#pragma mark - getter methods

- (MeatFoldUIComponent *)meatShopUIComponent{
    
    if (!_meatShopUIComponent) {
        _meatShopUIComponent = [[MeatFoldUIComponent alloc] init];
        
        @weakify(self);
        _meatShopUIComponent.dealFlodBlock = ^{
            @strongify(self);
            if (self.cellDelegate && [self.cellDelegate respondsToSelector:@selector(clickFoldLabel:)]) {
                [self.cellDelegate clickFoldLabel:self];
            }
        };
        
        _meatShopUIComponent.chooseCartBlock = ^(UIButton *btn) {
            @strongify(self);
            if (self.shopCartBlock) {
                self.shopCartBlock(btn);
            }
        };
    }
    return _meatShopUIComponent;
}

@end






















